package com.buercorp.wangyu.core1.ch9.treeSetDemo;

import java.util.TreeSet;

public class Text {
    public static void main(String[] args) {
        Student st1 = new Student(20,"zhangsan");
        Student st2 = new Student(18,"lisi");
        Student st3 = new Student(26,"wangwu");
        TreeSet<Student> ts = new TreeSet<>();
        ts.add(st1);
        ts.add(st2);
        ts.add(st3);
        for (Student t : ts) {
            System.out.println(t);
        }
    }

}
